<!-- BEGIN PAGE HEADER-->
<h3 class="page-title">
    <?php if($_GET['type'] == 'sell'){echo '求';}elseif($_GET['type'] == 'buy'){echo '看';}?>大腿订单
    <small></small>
</h3>
<div class="page-bar">
    <ul class="page-breadcrumb">
        <li>
            <i class="fa fa-home"></i>
            <a href="index.html">Home</a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            <a href="#">订单管理</a>
            <i class="fa fa-angle-right"></i>
        </li>
        <li>
            <a href="#">订单列表</a>
        </li>
    </ul>
</div>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box grey-cascade">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-globe"></i>
                    <?php
                    if($_GET['type'] == 'sell'){echo '求';}
                    elseif($_GET['type'] == 'buy'){echo '看';}
                    ?>大腿订单
                </div>
                <div class="tools">
                    <a href="javascript:;" class="collapse">
                    </a>
                    <a href="javascript:;" class="reload">
                    </a>
                    <a href="javascript:;" class="remove">
                    </a>
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-toolbar">
                    <div class="row">
                        <form role="search" action="#">
                            <input type="hidden" name="type" value="<?php echo $_GET['type']; ?>">
                            <div class="col-md-2 col-sm-12">
                                <input type="text" class="form-control" name="no" placeholder="请输入订单号" value="">
                            </div>
                            <div class="col-md-10 col-sm-12">
                                <div class="table-group-actions pull-right">
                                    <!--select class="table-group-action-input form-control input-inline input-small input-sm" name="authentication">
                                        <option value="">是否会员...</option>
                                        <option value="1">是</option>
                                        <option value="2">否</option>
                                    </select-->
                                    <select class="table-group-action-input form-control input-inline input-small input-sm" name="status">
                                        <option value="">请选择订单状态...</option>
                                        <option value="1">待支付</option>
                                        <option value="2">已支付</option>
                                        <option value="3">退款中</option>
                                        <option value="4">拒绝退款</option>
                                        <option value="5">已退款</option>
                                        <option value="6">已完成</option>
                                        <option value="7">已评价</option>
                                        <option value="8">已关闭</option>
                                        <option value="9">删除状态</option>
                                    </select>
                                    <button class="btn btn-sm yellow submit">
                                        <i class="fa fa-check"></i>
                                        搜索
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                    <tr>
                        <th class="table-checkbox">
                            <input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"/>
                        </th>
                        <th>
                            ID
                        </th>
                        <th>
                            发布昵称
                        </th>
                        <th>
                            客户昵称
                        </th>
                        <th>
                            订单号
                        </th>
                        <th>
                            价格
                        </th>
                        <th>
                            红包使用情况
                        </th>
                        <th>
                            支付
                        </th>
                        <th>
                            状态
                        </th>
                        <th>
                            购买时段
                        </th>
                        <th>
                            最后更新时间
                        </th>
                        <th>
                            备注
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach($lists as $value) { ?>
                        <tr class="odd gradeX">
                            <td>
                                <input type="checkbox" class="checkboxes" value="<?php echo $value['id']; ?>"/>
                            </td>
                            <td>
                                <?php echo $value['id']; ?>
                            </td>
                            <td>
                                <a title="点击查看详情" href="/admin/member/edit?id=<?php echo $value['from_uid'];?>"><?php echo $value['from_nick_name']; ?></a>
                            </td>
                            <td>
                                <a title="点击查看详情" href="/admin/member/edit?id=<?php echo $value['to_uid'];?>"><?php echo $value['to_nick_name']; ?></a>
                            </td>
                            <td>
                                <?php echo $value['order_no']; ?>
                            </td>
                            <td>
                                <?php echo $value['price']; ?>
                            </td>
                            <td>
                                <?php echo $value['envelope_id'];?>
                            </td>
                            <td>
                                <?php echo $value['pay_price']; ?>
                            </td>
                            <td>
                                <?php
                                switch($value['status']){
                                    case 1: echo '待支付'; break;
                                    case 2: echo '已支付'; break;
                                    case 3: echo '退款中'; break;
                                    case 4: echo '拒绝退款'; break;
                                    case 5: echo '已退款'; break;
                                    case 6: echo '已完成'; break;
                                    case 7: echo '已评价'; break;
                                    case 8: echo '已关闭'; break;
                                    case 9: echo '删除状态'; break;
                                }
                                ?>
                            </td>
                            <td>
                                
                            </td>
                            <td>
                                <?php echo date('Y-m-d H:i:s',$value['update_time']);?>
                            </td>
                            <td>
                                <?php echo $value['remark'];?>
                            </td>
                            <td>
                                <a class="btn btn-xs yellow" href="/admin/order/edit?id=<?php echo $value['id']; ?>" title="点击查看">详情</a>
                                <?php if($value['status']===\Lib\Consts::ORDER_STATUS_REFUND_FINISH) {?>
                                <a class="btn btn-xs red" href="/admin/refund/list?order_id=<?php echo $value['id']; ?>" title="点击查看">退款详情</a>
                                <?php }?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
                <?php
                $data = [
                    'count'   => $this->count,
                    'page'    => $this->page,
                    'perPage' => $this->perPage,
                ];
                echo $this->render('../../../views/layouts/pager.phtml', $data);
                ?>
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
</div>
<!-- END PAGE CONTENT-->